<template>
	<view style="padding: 50rpx;">
		<view class="back">
			<text>输入值：</text><input type="text" v-model="title" />
		</view>
		<view class="back" style="margin-top: 5px;">
			<text>传回值：</text><input type="text" :value="callBackValue" style="color: orangered;" />
		</view>
		<intenttext :intent="title" @sendToB="handleA2B"></intenttext>
		<intenttextB :fromA="bData" @sendBack="handleB2Parent"></intenttextB>
	</view>
</template>

<script>
	import intenttext from '@/components/intenttext.vue'
	import intenttextB from '@/components/intenttextB.vue'
	export default {
		components: {
			intenttext,
			intenttextB,
		},
		data() {
			return {
				bData: '',
				title: ' ',
				callBackValue: ''
			}
		},
		methods: {
		
			handleA2B(data) {
				this.bData = data;
			},
			
			handleB2Parent(data) {
				this.callBackValue = data;
			}
		},
	}
</script>

<style>
	.back {
		background-color: aliceblue;
		display: flex;
	}
</style>